package com.project.demo.service;

import com.project.demo.dao.HomestayOrdersMapper;
import com.project.demo.entity.HomestayOrders;
import com.project.demo.entity.vo.StatisticsVo;
import com.project.demo.service.base.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 民宿订单：(HomestayOrders)表服务接口
 *
 */
@Service
public class HomestayOrdersService extends BaseService<HomestayOrders> {
    @Autowired
    HomestayOrdersMapper mapper;


    public List<HomestayOrders> selectByUserId(Integer userId){
        List<HomestayOrders> homestayOrders = mapper.selectByUserId(userId,new Date());
        return homestayOrders;
    }

    public List<StatisticsVo> statistics(String startTime, String endTime,String nameOfHomestay) {
        return mapper.statistics(startTime,endTime,nameOfHomestay);
    }
}
